<!DOCTYPE html> 
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
    <meta content="telephone=no" name="format-detection" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <link rel="apple-touch-icon-precomposed" href="/themes/default/mobile/static/images/apple114.png" />
    <link rel="stylesheet" type="text/css" href="%THEME%/weixin/static/style/tenders.css" />
    <script type="text/javascript" src="<{$pager.res}>/script/kt.j.js"></script>
    <title>我的招标</title>
</head>
<body>
<div id="content">
<script type="text/javascript">
  document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  // 通过下面这个API隐藏右上角按钮
  WeixinJSBridge.call('hideOptionMenu');
  });
</script>
<header>
    <div class="head-top">
        <figure><img src="<{$wx_info.headimgurl}>"></figure>
        <h1><{$wx_info.nickname}></h1>
        <div><a href="<{link ctl='weixin/tenders:mytenders' args=$wx_info.openid}>" style="overflow:hidden;" class="click-point" data-point="5_1_1_1"><img src="%THEME%/weixin/static/images/wx/set.png"></a></div>
    </div>
</header>
<section>
<h1 style="width:90%;padding:0 10px;"><{$tenders.title|default:$tenders.contact}></h1>
</section>
<div class="huiyuan_intro" style="margin-bottom:30px;">
    <p><span class="title">招标类型：</span><{$tenders.from_title}></p>
    <p><span class="title">联系人：</span><{$tenders.contact}></p>
    <p><span class="title">电话：</span><{$tenders.mobile}></p>
    <p><span class="title">地址：</span><{$detail.city_name|default:'--'}>  <{$detail.area_name|default:'--'}><{$detail.addr|default:'--'}></p>
    <p><span class="title">小区名称：</span><{$tenders.home_name|default:'--'}></p>
    <p><span class="title">房屋面积：</span><{$tenders.area|default:'--'}></p>
    <p><span class="title">招标类型：</span><{$tenders.type_title|default:'--'}></p>
    <p><span class="title">喜欢风格：</span><{$tenders.style_title|default:'--'}></p>
    <p><span class="title">预算范围：</span><{$tenders.budget_title|default:'--'}></p>
    <p><span class="title">服务需求：</span><{$tenders.service_title|default:'--'}></p>
    <p><span class="title">空间户型：</span><{$tenders.house_type_title|default:'--'}></p>
    <p><span class="title">备注要求：</span><{$tenders.comment|default:'--'}></p>
</div>
<div class="look-all-message">
    <{if $tenders.sign_uid}>
    <img src="%THEME%/weixin/static/images/m/success.png"><a>招标已完成</a>
    <{elseif $tenders.audit}>
    <img src="%THEME%/weixin/static/images/m/being.png"><a>招标时行时</a>
    <{else}>
    <img src="%THEME%/weixin/static/images/m/being.png"><a>等待审核中</a>
    <{/if}>
</div>
<script type="text/javascript">
   $(function(){

      $("#attent").find("li").each(function(){
          var cname = parseInt($(this).find("h4").get(0).clientWidth);
          var adds = parseInt($(this).find("h5").get(0).clientWidth);
          var iwith = parseInt($(this).find("h5").find("i").get(0).clientWidth);
          adds = adds - iwith;
         // var adds = parseInt($("#adds").get(0).clientWidth);
          var cnum = parseInt((cname/16)-1);
          var anum = parseInt((adds/12)-1);
          var cstring = $(this).find("h4").text();
          var astring = $.trim($(this).find("h5").text());
          if ((cstring.length*16)>cname) {
            var cresult = cstring.substring(0,cnum)+"...";
            $(this).find("h4").text(cresult);
          }
          if ((astring.length*12)>adds) {
            var aresult = astring.substring(0,anum)+"...";
            $(this).find("h5").html("<i class='wx-icon icon-gps'></i>" + aresult);
          }               
      });
      
   });
</script>
</div>
<script>

function getThumbPicUrl( picUrl, suffix ) {
    if ( suffix.length ) {
        return picUrl + '&s=' + suffix;
    }
    return picUrl;
}


function shareFriend() {
    WeixinJSBridge.invoke('sendAppMessage',{
                            "appid": appid,
                            "img_url": imgUrl,
                            "img_width": "640",
                            "img_height": "640",
                            "link": lineLink,
                            "desc": descContent,
                            "title": shareTitle
                            }, function(res) {
                            _report('send_msg', res.err_msg);
                            })
}
function shareTimeline() {
    WeixinJSBridge.invoke('shareTimeline',{
                            "img_url": imgUrl,
                            "img_width": "640",
                            "img_height": "640",
                            "link": lineLink,
                            "desc": descContent,
                            "title": shareTitle
                            }, function(res) {
                            _report('timeline', res.err_msg);
                            });
}
function shareWeibo() {
    WeixinJSBridge.invoke('shareWeibo',{
                            "content": descContent,
                            "url": lineLink,
                            }, function(res) {
                            _report('weibo', res.err_msg);
                            });
}

// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
    // 发送给好友
    WeixinJSBridge.on('menu:share:appmessage', function (argv) {
        shareFriend();
    });
    // 分享到朋友圈
    WeixinJSBridge.on('menu:share:timeline', function (argv) {
        shareTimeline();
    });
    // 分享到微博
    WeixinJSBridge.on('menu:share:weibo', function (argv) {
        shareWeibo();
    });
}, false);
</script>

</body>
</html>
